package de.yvert.jingle.impl.openexr;

public class Channel
{

String name;
PixelType pixelType;
int reserved;
int xSampling, ySampling;

public Channel(String name, PixelType pixelType)
{
	this.name = name;
	this.pixelType = pixelType;
	this.reserved = 0;
	this.xSampling = 1;
	this.ySampling = 1;
}

public Channel()
{/*OK*/}

public int getLineLength(int width)
{ return pixelType.getSize()*width; }

public PixelType getPixelType()
{ return pixelType; }

public int getXSampling()
{ return xSampling; }

public int getYSampling()
{ return ySampling; }

@Override
public String toString()
{
	if ((xSampling != 1) || (ySampling != 1))
		return name+" "+pixelType+" sampling "+xSampling+"x"+ySampling+")";
	else
		return name+" "+pixelType;
}

public int calculateSize()
{ return name.length()+1+16; }

}
